﻿@model XPressify.Models.StatusCreateModel
@using XPressify.Data.Helpers

<script type="text/javascript">
    var defaultTxtStatus = "";
    function removeTextStatus(comment) {
        if (defaultTxtStatus == "") {
            defaultTxtStatus = comment.value;
        }
        comment.value = "";
        comment.style.color = "black";
    }
    function putTextStatus(comment) {
        if (comment.value == "") {
            var oldText = document.getElementById("myTxt");
            comment.style.color = "#666";
            comment.value = defaultTxtStatus;
        }
    }



    function successWriteStatus() {
        $(".newPostName").show("fast");
        $('.nobtn').css('color', 'blue');
        $('#Content').val('');
        $('#Content').focus();
    }
</script>



    @using (Ajax.BeginForm("StatusCreate", "Status", new AjaxOptions() { OnSuccess = "successWriteStatus", HttpMethod = "POST", UpdateTargetId = Model.UserPostedOnId.ToString(), InsertionMode = InsertionMode.InsertBefore }))
    {
        
        <table border="0" cellpadding="0" cellspacing="0" style="margin:0px;padding:0px;width:548px">
            <tr>
                <th style="padding: 0px 2px 0px 2px;" colspan = "2"> 
                    @Html.TextAreaFor(model => model.Content, 3, 65, new { style = "resize: none;color: #666;", onclick = "removeTextStatus(this)", onblur = "putTextStatus(this)" })
                </th>
            </tr>
            <tr >
               <td style="width:463px">
                    @Html.DropDownListFor(model => model.Privacy, new List<SelectListItem> { new SelectListItem { Text = "Everyone", Value = ObjectPrivacy.Everyone.ToString() }, new SelectListItem { Text = "Friends of friends", Value = ObjectPrivacy.FriendsOfFriends.ToString() }, new SelectListItem { Text = "Friends only", Value = ObjectPrivacy.FriendsOnly.ToString() }, new SelectListItem { Text = "Private", Value = ObjectPrivacy.Private.ToString() } }, new { style = "width:140px"})
               </td>
               <td style="text-align: right;">
                    <input type="submit" value="Share" />
                </td>
            </tr>
        </table>
        @Html.HiddenFor(model => model.UserPostedOnId)
        @Html.HiddenFor(model => model.BaseSubjectType)
        <input type="hidden" value="@Model.UserPostedOnId" name="profileId" />
    }